<template>
	<view class="container">
		<!-- 头部信息 -->
		<view class="top-info">
			<image class="bg" src="../../static/currencybg.png"></image>
			<view class="text-pos" v-if="money !== ''">
				<text class="text-one">￥</text>
				<text class="text-two">{{money}}</text>
			</view>
			<view class="text-pos" v-else>
				<text class="text-one">￥</text>
				<text class="text-two">0</text>
			</view>
			<button>所有返利</button>
		</view>
		
		
		<view class="profit">
			<text class="top-tetx">返利记录</text>
			
			<view class="top-profit">
				<view class="profit-info" v-for="(item,key) in list" :key="key"  v-if="list !== ''">
						
						<view class="all-profit">
							<text>{{item.created_at}}</text>
							<text>{{item.desc}}</text>
							<text>￥{{item.point}}</text>
						</view>
						
					</view>
					
					<view class="profit-info" v-else>
						<view class="all-profit">
							<text>暂无返利记录...</text>
						</view>
				</view>
			</view>
		</view>
		
		<view class="load">
			<view class="" v-if="!show">
				<uni-icons type="icon-jiazaizhong" color="#595959" size="25"></uni-icons>
				<text>加载中...</text>
			</view>
			<view class="" v-if="show">
				<!-- <uni-icons type="icon-zanwushuju" color="#595959" size="25"></uni-icons> -->
				<text>暂时没有更多数据了...</text>
			</view>
		</view>
	</view>
</template>

<script>
	import uniIcons from '../../ed-icons/ed-icons.vue'
	import { getOne } from '../../api/publicapi.js'
	
	export default {
		components: {
		
			uniIcons
		},  
		data() {
			return {
				select:' bill_select',
				selectfles:'top_item ',
				 user: {},
				      show: true,
				      list: [],
				      page: 1,
				      money: 0
			}
		},
		onShow() {
			this.getlist()
		},
		methods: {
			navTo(url){
				uni.navigateTo({  
					url
				})  
			},
			getlist(){
				 this.show = false
				      let data = {
				        'page': this.page
				      }
				getOne('front/owner/getrentrebate',data).then(res => {
				 this.money = (res.data.money).toFixed(2)
				        let list = res.data.rent
				        // console.log(res)
				        if (list.length > 0) {
				          for (let i = 0; i < list.length; i++) {
				            this.list.push(list[i])
				          }
				        }
						 this.show = true
				})
			}
		}
	}
</script>
<style lang="scss">
	.top-info{
		text-align: center;
		height: 380rpx;
		position: relative;
		
		.text-pos{
			text-align: center;
			padding-top: 130upx;
			
			.text-one{
				color: #fff;
				font-size: 40upx;
			}
			.text-two{
				color: #fff;
				font-size: 70upx;
			}
		}
		button{
			background: #ffa036;
			font-size: 36upx;
			width: 235upx;
			height: 70upx;
			border-radius: 30upx;
			color: #fff;
			border: 0;
			font-weight: 700;
			line-height: 65upx;
			position: absolute;
			bottom: 0;
			left: 255upx;
		}
		
		.bg{
			position:absolute;
			left: 0;
			top: 0;
			width: 100%;
			height: 380upx;
			filter: blur(1px);
			z-index: -1;
		}
	}
	
	.profit{
		margin-top: 35upx;
		
		.top-tetx{
			padding-left: 30upx;
			font-size: 35upx;
		}
		
		.top-profit{
			padding-top: 20upx;
		}
		
		.profit-info{
			width: 92%;
			margin: 0 auto;
			
			.all-profit{
				display: flex;
				justify-content: space-between;
				width: 100%;
				padding-top: 6upx;
				
				text{
					font-size: 30upx;
					color: #b2b2b2;
				}
			}
		}
		
	}
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	
	.bill_top{
		position: fixed;
		top: 0px;
		width: 100%;
		display: flex;	
		padding: 10px;
		justify-content:space-between;	
		border-bottom: 1px solid #F8F6FC;
		.top_item{
			color: #303133;
			border-bottom: 1px solid #fff;
			padding-right: 10px;
			padding-left: 10px;
			margin-left: 10px;
			margin-right: 10px;
			padding-bottom: 10px;
		}
		
	}
	.bill_select{
		color: #fa436a;
		border-bottom: 1px solid #fa436a;
		padding-right: 10px;
		padding-left: 10px;
		margin-left: 10px;
		margin-right: 10px;
		padding-bottom: 10px;
		
	}
	.bill_li{
		margin-left:20px;
		margin-right:20px;
		padding-bottom: 5px;
		display: flex;
		justify-content: space-between;
		border-bottom: 1px solid #C0C4CC;
	}
	
	.load {
		text-align: center;
		padding: 30upx;
		font-size: 30upx;
	}
</style>

